package com.twenty.seven.webapp.demo.controller;

import com.twenty.seven.common.ResultJson;
import com.twenty.seven.webapp.demo.feign.Demo1Service;
import com.twenty.seven.webapp.demo.feign.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author 001
 * @Date 2020/1/14 10:48
 * @TODO
 **/
@RestController
@RequestMapping(value = "/demo")
public class DemoController {

    @Autowired
    private DemoService demoService;

    @Autowired
    private Demo1Service demo1Service;

    @GetMapping("/get")
    public String getHello(){
        return demoService.getHello();
    }

    @GetMapping("/getById")
    public ResultJson get(){
        return demo1Service.queryById(6);
    }
}
